﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace bdnt_pets_system_Entity
{
    [DataContract]
    public class Tbl_Vehicle : INotifyPropertyChanged
    {

        Int32 id;
        [DataMember]
        public Int32 Id
        {
            get { return id; }
            set { id = value; }
        }

        bool isValidate = true;
        [DataMember]
        public bool IsValidate
        {
            get { return isValidate; }
            set { isValidate = value; }
        }

        string producitonNo;
        /// <summary>
        /// 生产流水号
        /// </summary>
        [DataMember]
        [Required(ErrorMessage = "*")]
        public string ProducitonNo
        {
            get { return producitonNo; }
            set
            {
                if (producitonNo != value && isValidate)
                {
                    Validator.ValidateProperty(value,
                        new ValidationContext(this, null, null) { MemberName = "ProducitonNo" });
                    producitonNo = value;
                    this.OnPropertyChanged("ProducitonNo");
                }
                else producitonNo = value;
            }
        }

        string vINNo;
        /// <summary>
        /// 车架号
        /// </summary>
        [DataMember]
        public string VINNo
        {
            get { return vINNo; }
            set
            {
                vINNo = value;
            }
        }

        string vColor;
        /// <summary>
        /// Color
        /// </summary>
        [DataMember]
        public string VColor
        {
            get { return vColor; }
            set { vColor = value; }
        }

        string vPhase;
        /// <summary>
        /// 生产/试件
        /// </summary>
        [DataMember]
        public string VPhase
        {
            get { return vPhase; }
            set { vPhase = value; }
        }

        string vType;
        /// <summary>
        /// 车辆型号
        /// </summary>
        [DataMember]
        public string VType
        {
            get { return vType; }
            set { vType = value; }
        }

        string remark;
        [DataMember]
        public string Remark
        {
            get { return remark; }
            set { remark = value; }
        }

        string vConfiguration;
        [DataMember]
        public string VConfiguration
        {
            get { return vConfiguration; }
            set { vConfiguration = value; }
        }

        string vConfigurationName;
        [DataMember]
        public string VConfigurationName
        {
            get { return vConfigurationName; }
            set { vConfigurationName = value; }
        }
        string en_vConfigurationName;
        [DataMember]
        public string en_VConfigurationName
        {
            get { return en_vConfigurationName; }
            set { en_vConfigurationName = value; }
        }
        string interiorColor;
        [DataMember]
        public string InteriorColor
        {
            get { return interiorColor; }
            set { interiorColor = value; }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string PropName)
        {
            if (PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(PropName));
            }
        }
    }
}
